// Created by wangliang on 2025/6/27.

import 'dart:io';

import 'package:flutter_app_demo/utils/logger.dart';
import 'package:live_flutter_plugin/v2_tx_live_premier.dart';

class LiveHelper {
  static String LICENSEURL = "https://license.vod2.myqcloud.com/license/v2/1301880320_1/v_cube.license";
  static String LICENSEURLKEY = "ac83c14c07b6af346a0ba9e32dc75b27";

  LiveHelper._();

  static final LiveHelper _instance = LiveHelper._();

  static LiveHelper get instance => _instance;

  init() {
    V2TXLivePremier.setObserver((type, params) {
      Log.d("==premier listener type= ${type.toString()}");
      Log.d("==premier listener param= $params");
    });
    V2TXLivePremier.setLicence(LICENSEURL, LICENSEURLKEY);
    _getSDKVersion();
  }

  _getSDKVersion() async {
    var sdkVersion = await V2TXLivePremier.getSDKVersionStr();
    var platformVersion = Platform.version;
    Log.d("Live SDK Version: $sdkVersion\nPlatform.version: $platformVersion");
  }
}
